bugfix(worldbuilder): fix optimized trees not being shown in object placer preview window#2312
Open
ViTeXFTW wants to merge 2 commits intoTheSuperHackers:mainfrom
Open
bugfix(worldbuilder): fix optimized trees not being shown in object placer preview window#2312ViTeXFTW wants to merge 2 commits intoTheSuperHackers:mainfrom
ViTeXFTW wants to merge 2 commits intoTheSuperHackers:mainfrom
Conversation
…lacer preview window
|
| Filename | Overview |
|---|---|
| GeneralsMD/Code/Tools/WorldBuilder/src/wbview3d.cpp | Adds fallback to handle W3DTreeDraw module data when W3DModelDraw fails, enabling tree preview in WorldBuilder object placer |
Last reviewed commit: 01e291e
xezon
approved these changes
Feb 15, 2026
xezon
left a comment
There was a problem hiding this comment.
Fix makes sense.
Code style can be polished.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When making Zero Hour the devs created an optimized module (W3DTreeDraw) for drawing trees. They forgot to add the preview handling in WorldBuilder to handle this new draw type, which results in the preview not showing anything when having an object of the W3DTreeDraw module selected.
Root Cause
WorldBuilder attempts to get the module data for getting the model name of the object. However the format of the
W3DModelDrawmodule data andW3DTreeDrawmodule data are different and there is not an exposed and generic way to get the information without explicitly casting the data to the expected type (W3DModelDrawModuleDataorW3DTreeDrawModuleData).Fix
Added a fallback function call to get the
W3DTreeDrawModuleDataif the normalW3DModelDrawfails which preserves the original behavior and also enables preview of tree types.Old:

New:
